From 8db6546ae81567da5cc967e1100b931d6e33a7fb Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 22 Jun 2005 17:40:09 +0000 Subject: [PATCH] bitkeeper revision 1.1726.1.3 (42b9a279xCcev3J_vAFv3hHoqI8lVw) Add cmpxchg8b support for writable page tables (emulation code path), which is needed to make atomic pae l1 page table updates work. Signed-off-by: Scott Parish --- xen/arch/x86/mm.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 9b3d631bc0..0487da6a44 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2793,12 +2793,24 @@ static int ptwr_emulated_cmpxchg( return ptwr_emulated_update(addr, old, new, bytes, 1); } +static int ptwr_emulated_cmpxchg8b( + unsigned long addr, + unsigned long old, + unsigned long old_hi, + unsigned long new, + unsigned long new_hi) +{ + return ptwr_emulated_update( + addr, ((u64)old_hi << 32) | old, ((u64)new_hi << 32) | new, 8, 1); +} + static struct x86_mem_emulator ptwr_mem_emulator = { - .read_std = x86_emulate_read_std, - .write_std = x86_emulate_write_std, - .read_emulated = x86_emulate_read_std, - .write_emulated = ptwr_emulated_write, - .cmpxchg_emulated = ptwr_emulated_cmpxchg + .read_std = x86_emulate_read_std, + .write_std = x86_emulate_write_std, + .read_emulated = x86_emulate_read_std, + .write_emulated = ptwr_emulated_write, + .cmpxchg_emulated = ptwr_emulated_cmpxchg, + .cmpxchg8b_emulated = ptwr_emulated_cmpxchg8b }; /* Write page fault handler: check if guest is trying to modify a PTE. */ -- 2.30.2